home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Magazine / Morphos / GCC / lib / gcc-lib / ppc-amigaos / 2.95.1 / sys-include / powerup / ppcpragmas / battmem_pragmas.h < prev    next >
C/C++ Source or Header  |  2000-03-13  |  3KB  |  103 lines

  1. /* Automatically generated header! Do not edit! */
  2.  
  3. #ifndef _PPCPRAGMA_BATTMEM_H
  4. #define _PPCPRAGMA_BATTMEM_H
  5. #ifdef __GNUC__
  6. #ifndef _PPCINLINE__BATTMEM_H
  7. #include <powerup/ppcinline/battmem.h>
  8. #endif
  9. #else
  10.  
  11. #ifndef POWERUP_PPCLIB_INTERFACE_H
  12. #include <powerup/ppclib/interface.h>
  13. #endif
  14.  
  15. #ifndef POWERUP_GCCLIB_PROTOS_H
  16. #include <powerup/gcclib/powerup_protos.h>
  17. #endif
  18.  
  19. #ifndef NO_PPCINLINE_STDARG
  20. #define NO_PPCINLINE_STDARG
  21. #endif/* SAS C PPC inlines */
  22.  
  23. #ifndef BATTMEM_BASE_NAME
  24. #define BATTMEM_BASE_NAME BattMemBase
  25. #endif /* !BATTMEM_BASE_NAME */
  26.  
  27. #define    ObtainBattSemaphore()    _ObtainBattSemaphore(BATTMEM_BASE_NAME)
  28.  
  29. static __inline void
  30. _ObtainBattSemaphore(void *BattMemBase)
  31. {
  32. struct Caos    MyCaos;
  33.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  34. //    MyCaos.M68kStart    =    NULL;
  35. //    MyCaos.M68kSize        =    0;
  36.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  37. //    MyCaos.PPCStart        =    NULL;
  38. //    MyCaos.PPCSize        =    0;
  39.     MyCaos.caos_Un.Offset    =    (-6);
  40.     MyCaos.a6        =(ULONG) BattMemBase;    
  41.     PPCCallOS(&MyCaos);
  42. }
  43.  
  44. #define    ReadBattMem(buffer, offset, length)    _ReadBattMem(BATTMEM_BASE_NAME, buffer, offset, length)
  45.  
  46. static __inline ULONG
  47. _ReadBattMem(void *BattMemBase, APTR buffer, unsigned long offset, unsigned long length)
  48. {
  49. struct Caos    MyCaos;
  50.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  51. //    MyCaos.M68kStart    =    NULL;
  52. //    MyCaos.M68kSize        =    0;
  53.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  54. //    MyCaos.PPCStart        =    NULL;
  55. //    MyCaos.PPCSize        =    0;
  56.     MyCaos.a0        =(ULONG) buffer;
  57.     MyCaos.d0        =(ULONG) offset;
  58.     MyCaos.d1        =(ULONG) length;
  59.     MyCaos.caos_Un.Offset    =    (-18);
  60.     MyCaos.a6        =(ULONG) BattMemBase;    
  61.     return((ULONG)PPCCallOS(&MyCaos));
  62. }
  63.  
  64. #define    ReleaseBattSemaphore()    _ReleaseBattSemaphore(BATTMEM_BASE_NAME)
  65.  
  66. static __inline void
  67. _ReleaseBattSemaphore(void *BattMemBase)
  68. {
  69. struct Caos    MyCaos;
  70.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  71. //    MyCaos.M68kStart    =    NULL;
  72. //    MyCaos.M68kSize        =    0;
  73.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  74. //    MyCaos.PPCStart        =    NULL;
  75. //    MyCaos.PPCSize        =    0;
  76.     MyCaos.caos_Un.Offset    =    (-12);
  77.     MyCaos.a6        =(ULONG) BattMemBase;    
  78.     PPCCallOS(&MyCaos);
  79. }
  80.  
  81. #define    WriteBattMem(buffer, offset, length)    _WriteBattMem(BATTMEM_BASE_NAME, buffer, offset, length)
  82.  
  83. static __inline ULONG
  84. _WriteBattMem(void *BattMemBase, APTR buffer, unsigned long offset, unsigned long length)
  85. {
  86. struct Caos    MyCaos;
  87.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  88. //    MyCaos.M68kStart    =    NULL;
  89. //    MyCaos.M68kSize        =    0;
  90.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  91. //    MyCaos.PPCStart        =    NULL;
  92. //    MyCaos.PPCSize        =    0;
  93.     MyCaos.a0        =(ULONG) buffer;
  94.     MyCaos.d0        =(ULONG) offset;
  95.     MyCaos.d1        =(ULONG) length;
  96.     MyCaos.caos_Un.Offset    =    (-24);
  97.     MyCaos.a6        =(ULONG) BattMemBase;    
  98.     return((ULONG)PPCCallOS(&MyCaos));
  99. }
  100.  
  101. #endif /* SASC Pragmas */
  102. #endif /* !_PPCPRAGMA_BATTMEM_H */
  103.